package com.ssm.controller;

import com.ssm.pojo.Admin;
import com.ssm.pojo.vo.AdminVO;
import com.ssm.pojo.vo.Result;
import com.ssm.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private IAdminService adminService;

    /**
     * 登录
     *
     */
    @GetMapping
    public Result<AdminVO> login(
            @RequestParam(name="username",required=true) String username,
            @RequestParam(name="password",required=true) String password
    ){
        return this.adminService.login(username, password);
    }
}
